package com.shengong.controller;

import com.shengong.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

//@Controller
@RestController //RestController = controller + responseBody
@RequestMapping("/user")
public class UserController {
    @RequestMapping("/getUser")
//    @ResponseBody
    public User getUser(){
        User user = new User();
        user.setName("shengong");
        user.setAge(18);
        user.setBirthday(new Date());
        user.setPassword("123456");
        return user;
    }
}
